package com.woniuxy.dudugua.controller;

import com.woniuxy.dudugua.entity.Product;
import com.woniuxy.dudugua.service.ProductService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("service")
public class ServiceController {
    @Resource
    private ProductService productService;

    @RequestMapping("answer")
    public String answer(String msg){
        String s = "";
        Product product = productService.getMax();
        if(msg.equals("1")){
            s = product.getProductName();
        }else if(msg.equals("2")){
            s ="如何购买，如何加盟";
        }else if(msg.equals("3")){
            s="客服微信：ddg123";
        }else{
            s="没有你要得答案";
        }
        return s;
    }

}
